package com.android.logcat.view;

import com.android.logcat.LoggerAidl;
import com.android.logcat.LoggerConfig;
import com.android.logcat.LoggerLevel;
import com.android.logcat.LoggerMonitor;

/**
 * @author GYL
 * @version 1.0
 * @dateTime 2020/7/1-14:26
 * @description 日志打印
 */
public class LoggerViewer implements LoggerMonitor {
  
  public LoggerViewer() {}
  
  @Override
  public synchronized void logger(@LoggerLevel String loggerLevel, String content) {
    LoggerAidl loggerAidl = LoggerConfig.getInstance().getLoggerAidl();
    if (loggerAidl != null) {
      try {
        loggerAidl.addLogger(loggerLevel, content);
      } catch (Exception e) {
      }
    }
    
  }
}
